package com.zhss.eshop.promotion.service.Impl;
import com.zhss.eshop.promotion.constant.PromotionActivityStatus;
import com.zhss.eshop.promotion.constant.PromotionActivityType;
import com.zhss.eshop.promotion.domain.dto.PromotionCouponDTO;
import com.zhss.eshop.promotion.domain.dto.PromotionActivityDTO;
import com.zhss.eshop.promotion.service.PromotionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 促销中心service组件
 * @author suyuan
 *
 */
@Service
public class PromotionServiceImpl implements PromotionService {

	private static final Logger logger = LoggerFactory.getLogger(PromotionServiceImpl.class);


	@Override
	public List<PromotionActivityDTO> listByGoodsId(Long goodsId) {
		List<PromotionActivityDTO> list=new ArrayList<>();
		PromotionActivityDTO promotionActivityDTO1=new PromotionActivityDTO();
		promotionActivityDTO1.setId(1L);
		promotionActivityDTO1.setName("测试促销活动1");
		promotionActivityDTO1.setStartTime(new Date());
		promotionActivityDTO1.setEndTime(new Date());
		promotionActivityDTO1.setRemark("");
		promotionActivityDTO1.setStatus(PromotionActivityStatus.ENABLED);
		promotionActivityDTO1.setRule("");
		promotionActivityDTO1.setType(PromotionActivityType.MULTI_DISCOUNT);
		promotionActivityDTO1.setGmtCreate(new Date());
		promotionActivityDTO1.setGmtModified(new Date());
		PromotionActivityDTO promotionActivityDTO2=new PromotionActivityDTO();
		promotionActivityDTO2.setId(2L);
		promotionActivityDTO2.setName("测试促销活动2");
		promotionActivityDTO2.setStartTime(new Date());
		promotionActivityDTO2.setEndTime(new Date());
		promotionActivityDTO2.setRemark("");
		promotionActivityDTO2.setStatus(PromotionActivityStatus.ENABLED);
		promotionActivityDTO2.setRule("");
		promotionActivityDTO2.setType(PromotionActivityType.REACH_GIFT);
		promotionActivityDTO2.setGmtCreate(new Date());
		promotionActivityDTO2.setGmtModified(new Date());

		list.add(promotionActivityDTO1);
		list.add(promotionActivityDTO2);
		return list;
	}

	@Override
	public PromotionActivityDTO getById(Long id) {
		return null;
	}

	@Override
	public List<PromotionCouponDTO> listValidByUserAccountId(Long userAccountId) {
		return null;
	}

	@Override
	public Boolean useCoupon(Long couponId, Long userAccountId) {
		return null;
	}
}
